home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / GUICtrlSendMsg.au3 < prev    next >
Text File  |  2006-06-17  |  650b  |  27 lines

  1. #include <GUIConstants.au3>
  2.  
  3. GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
  4.  
  5. $nEdit = GUICtrlCreateEdit ("line 0", 10,10)
  6. GUICtrlCreateButton ("Ok", 20,200,50)
  7. GUISetState ()
  8.  
  9. for $n=1 to 5
  10. GUICtrlSetData ($nEdit,@CRLF & "line "& $n)
  11. next
  12.  
  13. $EM_LINEINDEX = 0x00BB
  14. $EM_LINEFROMCHAR = 0x00C9
  15.  
  16. ; Run the GUI until the dialog is closed
  17. Do
  18.     $msg = GUIGetMsg()
  19.     if $msg >0 then
  20.         $n=GUICtrlSendMsg ($nEdit, $EM_LINEINDEX,-1,0)
  21.         $nline=GUICtrlSendMsg( $nEdit, $EM_LINEFROMCHAR,$n,0)
  22.         GUICtrlSetState ($nEdit,256)    ; set focus
  23.  
  24.         MsgBox (0,"Currentline",$nLine)
  25.     endif
  26. Until $msg = $GUI_EVENT_CLOSE
  27.